<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>用户信息管理</title>
    <link rel="stylesheet" th:href="@{/static/plugins/layui/css/layui.css}" media="all">
    <link rel="stylesheet" th:href="@{/static/css/manage/style.css}" media="all">
</head>
<body>
    <div class="layui-fluid">
        <div class="layui-card">
            <div class="layui-card-body" style="padding: 15px;">
                <form class="layui-form layui-form-pane" action="">
                    <input name="userInfoId" th:value="${obj?.userInfoId}" class="layui-input layui-hide"/>
                    <div class="layui-form-item">
                        <label class="layui-form-label">用户名</label>
                        <div class="layui-input-block" th:style="'display:' + ${obj?.username == null ?'block': 'none'}">
                            <th:block th:if="${obj?.username == null}">
                                <select name="username" lay-verify="required" id="username">
                                    <option th:placeholder="请选择"></option>
                                    <th:block th:each="user : ${users}">
                                        <option th:text="${user.username}" th:value="${user.username}"></option>
                                    </th:block>
                                </select>
                            </th:block>
                        </div>
                        <div class="layui-input-block" th:style="'display:' + ${obj?.username != null ?'block': 'none'}">
                            <th:block th:if="${obj?.username != null}">
                                <input type="text" th:name="${obj?.username} == null?' ':'username'" th:value="${obj?.username}" lay-verify="required" readonly placeholder="请输入用户名" autocomplete="off" class="layui-input">
                            </th:block>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">真实姓名</label>
                        <div class="layui-input-block">
                            <input type="text" name="realName" th:value="${obj?.realName}" placeholder="请输入用户真实姓名" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">证件类型</label>
                        <div class="layui-input-block">
                            <select name="identityCardType" id="identityCardType">
                                <th:block th:if="${obj?.identityCardType} == '1'">
                                    <option value="0">请选择证件类型</option>
                                    <option selected value="1">身份证</option>
                                    <option value="2">军官证</option>
                                    <option value="3">护照</option>
                                </th:block>
                                <th:block th:if="${obj?.identityCardType} == '2'">
                                    <option value="0">请选择证件类型</option>
                                    <option selected value="1">身份证</option>
                                    <option value="2">军官证</option>
                                    <option value="3">护照</option>
                                </th:block>
                                <th:block th:if="${obj?.identityCardType} == '3'">
                                    <option value="0">请选择证件类型</option>
                                    <option selected value="1">身份证</option>
                                    <option value="2">军官证</option>
                                    <option value="3">护照</option>
                                </th:block>
                                <th:block th:unless="${obj}">
                                    <option value="0">请选择证件类型</option>
                                    <option value="1">身份证</option>
                                    <option value="2">军官证</option>
                                    <option value="3">护照</option>
                                </th:block>
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">证件号码</label>
                        <div class="layui-input-block">
                            <input type="text" name="identityCardNo" th:value="${obj?.identityCardNo}" placeholder="请输入用户证件号码" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">性别</label>
                        <div class="layui-input-block sex">
                            <th:block th:if="${obj?.userSex} == '男'">
                                <input type="radio" checked name="userSex" value="男" title="男">
                                <input type="radio" name="userSex" value="女" title="女">
                            </th:block>
                            <th:block th:if="${obj?.userSex} == '女'">
                                <input type="radio" name="userSex" value="男" title="男">
                                <input type="radio" checked  name="userSex" value="女" title="女">
                            </th:block>
                            <th:block th:unless="${obj}">
                                <input type="radio" name="userSex" value="男" title="男">
                                <input type="radio" name="userSex" value="女" title="女">
                            </th:block>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">手机号码</label>
                        <div class="layui-input-block">
                            <input type="text" name="mobilePhone" th:value="${obj?.mobilePhone}" placeholder="请输入用户手机号码" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">邮箱</label>
                        <div class="layui-input-block">
                            <input type="text" name="email" th:value="${obj?.email}" placeholder="请输入用户邮箱" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">生日</label>
                        <div class="layui-input-block">
                            <input type="text" id="birthday" name="birthday" readonly th:value="${obj?.birthdayStr}" placeholder="请输入用户生日" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">用户余额</label>
                        <div class="layui-input-block">
                            <input type="text" name="userMoney" th:value="${obj == null?'0.00':obj.userMoney}" placeholder="请输入用户余额" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item layui-hide">
                        <input type="button" lay-submit lay-filter="lay-front-submit" id="lay-front-submit" value="确认">
                    </div>
                </form>
            </div>
        </div>
    </div>
    <script th:src="@{/static/plugins/layui/layui.js}"></script>
    <script th:src="@{/static/js/manage/user/userInfo.js}"></script>
    <script th:inline="javascript">
        window.onload = function (){
            layui.use(['table','form','laydate'],function () {
                let laydate = layui.laydate;
                var $ = layui.$;
                //支持日期控件
                laydate.render({
                    elem: '#birthday',
                    trigger: 'click'
                });

            })
        }

    </script>
</body>
</html>
















